home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
fungetc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-17
|
342b
|
17 lines
/* from dlibs */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int fungetc(c, fp)
int c;
register FILE *fp;
{
if((fp->_flag & (_IOERR | _IOEOF)) /* error or eof */
|| (fp->_ptr <= fp->_base) /* or too many ungets */
|| (c < 0)) /* or trying to unget EOF */
return(EOF);
++(fp->_cnt);
return(*--(fp->_ptr) = c);
}